package com.example.rouroudate.ui.gallery.ui

import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.BaseAdapter
import android.widget.TextView
import com.example.rouroudate.R

class DateListAdapter(private val data: ArrayList<String>, private val context: Context) : BaseAdapter() {

    override fun getCount() = Int.MAX_VALUE

    override fun getItem(position: Int) = data[position % data.size]

    override fun getItemId(position: Int): Long {
        return position.toLong()
    }

    override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View {
        val view = LayoutInflater.from(context).inflate(R.layout.list_view_item, null)
        view.findViewById<TextView>(R.id.item_tv).apply {
            text = getItem(position)
        }
        return view
    }

    override fun isEnabled(position: Int): Boolean {
        return false
    }
}